<!--颜色，没有ID和name-->
<template>
  <el-color-picker
    v-model="value"
    v-bind="$attrs"
  >
  </el-color-picker>
</template>

<script setup lang="ts" generic="T extends object">
  import type { IFormItemProps } from '../../map'
  import { itemController } from '../../map'

  defineOptions({
    name: 'nf-el-form-item-color',
    inheritAttrs: false,
  })

  // 定义 props
  const props = withDefaults(defineProps<IFormItemProps<T>>(), {
    meta: () => {
      return {
        colName: ''
      }
    },
    model: () => {
      return {} as T
    },
    clearable: true 
  })
  
  // 支持防抖等功能
  const {
    value 
  } = itemController(props)

</script>